package com.yida.gwj.common.domain.mq;

import com.yida.gwj.common.enums.MqDelayLevelEnum;

/**
 * mq请求参数
 *
 * @author liangp
 * @date 2023/02/15
 */
public class MqSendRequest {
    /**
     * 主题
     */
    private String topic;
    /**
     * 一般用于消息在业务层面的唯一标识。对发送的消息设置好 Key，以后可以根据这个 Key 来查找消息
     */
    public String key;
    /**
     * 消息标签，二级消息类型，用来进一步区分某个 Topic 下的消息分类
     */
    private String tag;
    /**
     * level 1s 5s 10s 30s 1m 2m 3m 4m 5m 6m 7m 8m 9m 10m 20m 30m 1h 2h
     * level == 0，消息为非延迟消息1<=level<=maxLevel，消息延迟特定时间，例如level1，延迟1s
     * level > maxLevel，则level maxLevel，例如level==20，延迟2h
     */
    private MqDelayLevelEnum level;

    public MqSendRequest() {
    }
    
    public MqSendRequest(String topic, String key, String tag, MqDelayLevelEnum level) {
        this.topic = topic;
        this.key = key;
        this.tag = tag;
        this.level = level;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public MqDelayLevelEnum getLevel() {
        return level;
    }

    public void setLevel(MqDelayLevelEnum level) {
        this.level = level;
    }

    @Override
    public String toString() {
        return "MqSendRequest{" +
                "topic='" + topic + '\'' +
                ", key='" + key + '\'' +
                ", tag='" + tag + '\'' +
                ", level=" + level +
                '}';
    }

}
